/*
 * TryHost.scala
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package trypkg

object TryHost {
    def main(args : Array[String]):Unit = {
//        val url1 = new java.net.URL("http://finance.sina.com.cn/stock/")
//        val url2 = new java.net.URL("http://finance.sina.com.cn/stock/t/20090730/01342979565.shtml")
//        val url3 = new java.net.URL("http://finance.sina.com.cn/stock/dxfjj.shtml")
//        println("http://finance.sina.com.cn/stock/dxfjj.shtml host=" + url1.getHost)
//        println("http://finance.sina.com.cn/stock/t/20090730/01342979565.shtml host=" + url2.getHost)
//        println("http://finance.sina.com.cn/stock/dxfjj.shtml host=" + url3.getHost)

        val url1 = new java.net.URL("http://messages.yahoo.com/Business_%26_Finance/threadview?m=tm&bn=17929261%23businessopportunityboard&tid=30108&mid=30108&tof=1&frt=2")
        println(url1.toString.contains("messages.yahoo.com/Business_%26_Finance"))
        val url2 = new java.net.URL("http://biz.cn.yahoo.com/09-08-/137/tthd.html")
        println(url2.getHost)
        val url3 = new java.net.URL("http://messages.yahoo.com/Cultures_%26_Community/Countries_and_Cultures/American_Cultures/threadview?m=tm&bn=9195318&tid=1167&mid=1167&tof=1&frt=2")
        println(url3.getHost)
    }
}
